@echo off
rem download ant/ant-contrib
call :downloadFile "apache-ant-1.9.2-bin.zip" "http://mirrors.cnnic.cn/apache//ant/binaries/apache-ant-1.9.2-bin.zip"
call :downloadFile "ant-contrib-1.0b3-bin.zip" "http://downloads.sourceforge.net/project/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3-bin.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fant-contrib%2Ffiles%2Fant-contrib%2F1.0b3%2F&ts=1375253292&use_mirror=superb-dca3"
if not exist "apache-ant-1.9.2" (unzip "apache-ant-1.9.2-bin.zip")
if not exist "ant-contrib" (unzip "ant-contrib-1.0b3-bin.zip")
call .\apache-ant-1.9.2\bin\ant -buildfile bs-win32.xml

goto :EOF

:downloadFile 
setlocal
if not exist %1 (wget %2 --user-agent="Mozilla/5.0 (Windows NT 5.2) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1" --no-check-certificate) else (echo %1 exists, continue to next...)
endlocal&goto :EOF
